﻿<UserControl x:Class="JAAF.UI.WPF.TaskButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:JAAF.UI.WPF"
             mc:Ignorable="d" 
             d:DesignHeight="173" d:DesignWidth="383" MaxWidth="280"
             x:Name="Root" Cursor="Hand">

    <Button HorizontalContentAlignment="Left" VerticalContentAlignment="Center"  Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:TaskButton}}, Path=Command}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Image Grid.Column="0" Grid.RowSpan="2" Margin="5" MaxHeight="64" MaxWidth="64"
                   Source="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:TaskButton}}, Path=ImageSource}" Opacity="1" />
            
            <TextBlock Grid.Column="1" Grid.Row="0" FontSize="16" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center" TextWrapping="Wrap"  Margin="2" 
                       Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:TaskButton}}, Path=Text}"/>

            <TextBlock Grid.Column="1" Grid.Row="1" FontSize="11" HorizontalAlignment="Left" VerticalAlignment="Center" TextWrapping="Wrap" Margin="2" 
                       Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:TaskButton}}, Path=Documentation}" />
            
        </Grid>
    </Button>
</UserControl>
